package com.office.web.controller.file.mapper;

import com.office.web.controller.file.domain.FileUploadDomain;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author: 柒月
 * @date: 2025/5/28 下午2:32
 * @version: 1.0
 */
@Mapper
public interface FileUploadMapper {

    /**
     *
     * @param fileUploadDomain 插入文件信息
     */
    public void insertFileUploadInfo(FileUploadDomain fileUploadDomain);

    /**
     * 删除单个文件
     *
     * @param id 文件id
     * @return 结果
     */
    @Delete("delete from sys_file where id = #{id}")
    public Integer deleteFileById(Long id);

    /**
     * 批量删除文件
     *
     * @param fileIds 文件ids
     * @return 结果
     */
    public int deleteFileByIds(@Param("fileIds") Long[] fileIds);

    /**
     * @param fileName 删除的文件名
     * @return 影响的结果
     */
    @Delete("delete from sys_file where file_name = #{fileName}")
    public Integer deleteFileByName(String fileName);
}
